package com.huaao.micropolice.core.repository.system;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.huaao.micropolice.core.model.system.Area;
import com.huaao.micropolice.core.model.system.Dept;
import com.huaao.micropolice.core.model.system.User;
import com.huaao.micropolice.core.repository.BaseDao;

@Repository
public class AreaDao extends BaseDao{
	
	public List<Area> findByAreaParentId(String id) {
		List<Area> items = null;
		items = getSession().createQuery("FROM Area where parent.id = ? order by name").setString(0, id).list();
		return items;
	}
	
	public List<Area> findAll() {
		return getSession().createQuery("FROM Area order by name").list();
	}
}
